home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Purity / Purity #42 (1995-01)(PackMAN)(DE)[WB].zip / Purity #42 (1995-01)(PackMAN)(DE)[WB].adf / Includes3v1 / Includes3v1.lha / Workbench / Workbench.i < prev   
Text File  |  1994-12-04  |  7KB  |  193 lines

  1. {
  2.         Workbench.i for PCQ Pascal
  3. }
  4.  
  5. {$I   "Include:Exec/Nodes.i"}
  6. {$I   "Include:Exec/Lists.i"}
  7. {$I   "Include:Exec/Tasks.i"}
  8. {$I   "Include:Intuition/Intuition.i"}
  9. {$I   "Include:WorkBench/Startup.i"}
  10. {$I   "Include:DOS/DOS.i"}
  11.  
  12. VAR  WorkbenchBase : Address;
  13.  
  14. Const
  15.  
  16.     WBDISK              = 1;
  17.     WBDRAWER            = 2;
  18.     WBTOOL              = 3;
  19.     WBPROJECT           = 4;
  20.     WBGARBAGE           = 5;
  21.     WBDEVICE            = 6;
  22.     WBKICK              = 7;
  23.     WBAPPICON           = 8;
  24.  
  25. Type
  26.  
  27.     OldDrawerData = record
  28.         dd_NewWindow    : NewWindow;    { args to open window }
  29.         dd_CurrentX     : Integer;      { current x coordinate of origin }
  30.         dd_CurrentY     : Integer;      { current y coordinate of origin }
  31.     end;
  32.     OldDrawerDataPtr = ^OldDrawerData;
  33.  
  34. Const
  35.  
  36. { the amount of DrawerData actually written to disk }
  37.  
  38.     OLDDRAWERDATAFILESIZE  = 56;  { sizeof(OldDrawerData) }
  39.  
  40. Type
  41.     DrawerData = record
  42.         dd_NewWindow    : NewWindow;    { args to open window }
  43.         dd_CurrentX     : Integer;      { current x coordinate of origin }
  44.         dd_CurrentY     : Integer;      { current y coordinate of origin }
  45.         dd_Flags        : Integer;      { flags for drawer }
  46.         dd_ViewModes    : Short;        { view mode for drawer }
  47.     end;
  48.     DrawerDataPtr = ^DrawerData;
  49.  
  50. Const
  51.  
  52. { the amount of DrawerData actually written to disk }
  53.  
  54.     DRAWERDATAFILESIZE  = 62;  { sizeof(DrawerData) }
  55.  
  56.  
  57. Type
  58.  
  59.     DiskObject = record
  60.         do_Magic        : Short;        { a magic number at the start of the file }
  61.         do_Version      : Short;        { a version number, so we can change it }
  62.         do_Gadget       : Gadget;       { a copy of in core gadget }
  63.         do_Type         : Byte;
  64.         do_DefaultTool  : String;
  65.         do_ToolTypes    : Address;
  66.         do_CurrentX     : Integer;
  67.         do_CurrentY     : Integer;
  68.         do_DrawerData   : DrawerDataPtr;
  69.         do_ToolWindow   : String;       { only applies to tools }
  70.         do_StackSize    : Integer;      { only applies to tools }
  71.     end;
  72.     DiskObjectPtr = ^DiskObject;
  73.  
  74. Const
  75.  
  76.     WB_DISKMAGIC        = $e310;        { a magic number, not easily impersonated }
  77.     WB_DISKVERSION      = 1;            { our current version number }
  78.     WB_DISKREVISION     = 1;            { our current revision number }
  79.   {I only use the lower 8 bits of Gadget.UserData for the revision # }
  80.     WB_DISKREVISIONMASK = 255;
  81. Type
  82.  
  83.     FreeList = record
  84.         fl_NumFree      : Short;
  85.         fl_MemList      : List;
  86.     end;
  87.     FreeListPtr = FreeList;
  88.  
  89. Const
  90.  
  91. { each message that comes into the WorkBenchPort must have a type field
  92.  * in the preceeding short.  These are the defines for this type
  93.  }
  94.  
  95.     MTYPE_PSTD          = 1;    { a "standard Potion" message }
  96.     MTYPE_TOOLEXIT      = 2;    { exit message from our tools }
  97.     MTYPE_DISKCHANGE    = 3;    { dos telling us of a disk change }
  98.     MTYPE_TIMER         = 4;    { we got a timer tick }
  99.     MTYPE_CLOSEDOWN     = 5;    { <unimplemented> }
  100.     MTYPE_IOPROC        = 6;    { <unimplemented> }
  101.     MTYPE_APPWINDOW     = 7;    {     msg from an app window }
  102.     MTYPE_APPICON       = 8;    {     msg from an app icon }
  103.     MTYPE_APPMENUITEM   = 9;    {     msg from an app menuitem }
  104.     MTYPE_COPYEXIT      = 10;   {     exit msg from copy process }
  105.     MTYPE_ICONPUT       = 11;   {     msg from PutDiskObject in icon.library }
  106.  
  107.  
  108. { workbench does different complement modes for its gadgets.
  109.  * It supports separate images, complement mode, and backfill mode.
  110.  * The first two are identical to intuitions GADGIMAGE and GADGHCOMP.
  111.  * backfill is similar to GADGHCOMP, but the region outside of the
  112.  * image (which normally would be color three when complemented)
  113.  * is flood-filled to color zero.
  114.  }
  115.  
  116.     GFLG_GADGBACKFILL   = $0001;
  117.     GADGBACKFILL        = $0001;   { an old synonym }
  118.  
  119. { if an icon does not really live anywhere, set its current position
  120.  * to here
  121.  }
  122.  
  123.     NO_ICON_POSITION    = $80000000;
  124.  
  125. {    workbench now is a library.  this is it's name }
  126. CONST
  127.  WORKBENCH_NAME    =      "workbench.library";
  128.  
  129. {    If you find am_Version >= AM_VERSION, you know this structure has
  130.  * at least the fields defined in this version of the include file
  131.  }
  132.  AM_VERSION   =   1;
  133.  
  134. Type
  135.    AppMessage = Record
  136.     am_Message       : Message;            {    standard message structure }
  137.     am_Type          : Short;              {    message type }
  138.     am_UserData      : Integer;            {    application specific }
  139.     am_ID            : Integer;            {    application definable ID }
  140.     am_NumArgs       : Integer;            {    # of elements in arglist }
  141.     am_ArgList       : WBArgListPtr;       {    the arguements themselves }
  142.     am_Version       : Short;              {    will be AM_VERSION }
  143.     am_Class         : Short;              {    message class }
  144.     am_MouseX        : Short;              {    mouse x position of event }
  145.     am_MouseY        : Short;              {    mouse y position of event }
  146.     am_Seconds       : Integer;            {    current system clock time }
  147.     am_Micros        : Integer;            {    current system clock time }
  148.     am_Reserved      : Array[0..7] of Integer;       {    avoid recompilation }
  149.    END;
  150.    AppMessagePtr = ^AppMessage;
  151.  
  152. {
  153.  * The following structures are private.  These are just stub
  154.  * structures for code compatibility...
  155.  }
  156.  AppWindow = Record aw_PRIVATE : Address; END;
  157.  AppWindowPtr = ^AppWindow;
  158.  AppIcon = Record ai_PRIVATE : Address; END;
  159.  AppIconPtr = ^AppIcon;
  160.  AppMenuItem = Record ami_PRIVATE : Address; END;
  161.  AppMenuItemPtr = ^AppMenuItem;
  162.  
  163.  
  164.  FUNCTION AddAppWindowA(ID, UserData : Integer; Win : WindowPtr; 
  165.                         Port : MsgPortPtr; TagList : Address) : AppWindowPtr;
  166.   External;
  167.  
  168.  FUNCTION RemoveAppWindow(AppWin : AppWindowPtr) : Boolean;
  169.   External;
  170.  
  171.  FUNCTION AddAppIconA(ID, UserData : Integer; Txt : String; Port : MsgPortPtr;
  172.                       FL : FileLock; diskobj : DiskObjectPtr; taglist : Address) : AppIconPtr;
  173.   External;
  174.  
  175.  FUNCTION RemoveAppIcon(AIcon : AppIconPtr) : Boolean;
  176.   External;
  177.  
  178.  FUNCTION AddAppMenuItem(ID, UserData : Integer; Txt : String; Port : MsgPortPtr;
  179.                          taglist : Address) : AppMenuItemPtr;
  180.   External;
  181.  
  182.  FUNCTION RemoveAppMenuItem(AppMI : AppMenuItemPtr) : Boolean;
  183.   External;
  184.  
  185.  
  186.  { --- functions in V39 or higher (Release 3) --- }
  187.  
  188.  PROCEDURE WBInfo(l : Address; name : String; Scr : ScreenPtr);
  189.                  { l = lock }
  190.     External;
  191.  
  192.  
  193.